<template>
  <div>
    <!-- 动态组件 -->
    <!-- <el-row>
      <el-col :span="24">
        <el-button type="primary" @click="handleSwitchComponent('transposing')">transposing page</el-button>
        <el-button type="primary" @click="handleSwitchComponent('addTransposing')">addTransposing page</el-button>
      </el-col>
    </el-row> -->
    <keep-alive>
      <component v-bind:is="currentTabComponent" @switchComponent="handleSwitchComponent" :obj="obj"></component>
    </keep-alive>
  </div>
</template>
<script>
export default {
  name:'async-component',
  data(){
    return {
      currentTabComponent:'transposing',
      obj:{}
    }
  },
  mounted(){

  },
  components:{
    transposing:()=>import('@/business/warehouseManagement/transposing/transposing'),
    addTransposing:()=>import('@/business/warehouseManagement/transposing/add'),
    transInfo:()=>import('@/business/warehouseManagement/transposing/transInfo')
  },
  methods:{
    handleSwitchComponent(obj){
      this.obj=obj
      this.currentTabComponent = obj.componentName
    }
  }
}
</script>
<style lang="scss" scoped>

</style>